<?php

declare(strict_types=1);

namespace Api\InterfaceApi\v1\Work;

use App\CustHub\Model\ChCorp;
use Mine\MineApi;

class CorpApi extends MineApi
{
    /**
     * 获取已授权的企业列表
     * @return \Psr\Http\Message\ResponseInterface
     * @throws \Psr\Container\ContainerExceptionInterface
     * @throws \Psr\Container\NotFoundExceptionInterface
     */
    public function getCorpList(): \Psr\Http\Message\ResponseInterface
    {
        $data = $this->request->all();

        $list = ChCorp::query()
            ->where('main_uid',$data['uid'])
            ->where('type',0)
            ->where('auth_status',1)
            ->get();

        return $this->success($list);
    }
}